import './assets/main.css'

import router from './router'
import { createApp } from 'vue'
import axios from 'axios';
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import { createPinia } from 'pinia'
import store from './store'

//创建一个Pinia实例,用于在应用中集中管理状态(store)
const pinia = createPinia()
const app = createApp(App)

app.use(router)
app.use(ElementPlus)
app.use(pinia) 
app.use(store)
app.config.globalProperties.urlA = 'http://localhost:8081'
app.config.globalProperties.axios = axios



	//全局前置守卫
	router.beforeEach((to, from, next) => {
	    //console.log("to:",to) //即将进入的路由的信息
	    //console.log("from:",from) //当前即将离开的路由信息

	    next()

	    /*
	        if(to.name == "history"){
	            next(false) //拦截
	        }else{
	            next() //继续
	        }
	    */
	})

app.mount('#app')
